package com.xinyue.auto.reader;

import com.xinyue.auto.Label;

public abstract class ProcessContext extends Process implements Label{
	//持有Reader对象
	private Process read;
	
	/**
	 * 构造器
	 * @param read
	 */
	public ProcessContext(Process read) {
		this.read = read;
	}

	/**
	 * 读取XML数据，并对数据进行处理
	 * @throws Exception 
	 */
	@Override
	public void work() throws Exception {
		read.work();
		//验证XML数据是否合法，并将通过验证的数据封装至对象
		process();
	}

	//验证并处理XML数据
	protected abstract void process() throws Exception;
}
